package com.example.springbootexamples;

import org.junit.Test;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

public class RestDemo {


    @Test
    public void t(){


        try {
            RestTemplate restTemplate = new RestTemplate();

            HttpHeaders httpHeaders = new HttpHeaders();
            Map<String, Object> map = new HashMap<>();
            HttpEntity httpEntity = new HttpEntity(httpHeaders);

            ResponseEntity responseEntity = restTemplate.postForEntity("http://localhost", httpEntity, String.class);
            Object o = responseEntity.getBody();
            System.out.println(o);
        }catch (Exception e){
            e.printStackTrace();
        }

    }


}
